After I was able to dual boot into NixOS/Plasma, I needed to configure it.
Scaling the display
The default scaling on my 1,920 by 1,200 screen was too small to be legible. I set and applied Scale as 150% in System Settings > Display & Monitor > Display Configuration. This was also reflected on the lock screen but not the initial log-in screen.
Configuration file
NixOS is principally configured by the contents of the file /etc/nixos/configuration.nix. When the file is changed, the changes are applied by commanding sudo nixos-rebuild switch.
The file contains a function, which takes an attribute set containing at least config and pkgs as an argument and yields another attribute set:
|
1 |
{ config, pkgs, ... } : { } |
pkgs is determined by sudo nix-channel --list, being:
|
1 |
nixos https://channels.nixos.org/nixos-26.05 |
That, itself, can be updated with sudo nix-channel --update. The configuration does not change unless it is rebuilt.
One part of the latter attribute set is environment.systemPackages. I initially equated that to:
|
1 2 3 4 5 6 7 8 9 10 11 |
environment.systemPackages = with pkgs; [ efibootmgr gimp haskell-language-server inkscape librecad stack vscode wget xdg-utils ]; |
efibootmgr was added to diagnose duplicate ‘Linux Boot Manager’ entries. xdg-utils was added because one of the tools it provides is used by the Haskell package open-browser.
Terminal
Konsole was already available as a terminal. I created a default profile Default and set its appearance to use Colour scheme Solarised and Font Fira Code 12pt. That font was configured by:
|
1 2 3 4 |
fonts.packages = with pkgs; [ fira-code fira-code-symbols ]; |
Fira Code provides programming ligatures, but Konsole does not allow the fine-grained configuration that, say, Windows Terminal provides.
Browser
Some packages can be added as attributes of the packages attribute. firefox is an example, and was already configured:
|
1 |
programs.firefox.enable = true; |
Git
Git is also an attribute of the packages attribute:
|
1 2 3 4 5 6 7 8 9 |
programs.git = { enable = true; config = { user.name = "Mike Pilgrem"; user.email = "14206448+mpilgrem@users.noreply.github.com"; init.defaultBranch = "main"; core.editor = "code --wait"; }; }; |
Editor
I wanted to use Visual Studio (VS) Code. It is also an attribute of the packages attribute. I tried:
|
1 2 3 4 |
programs.vscode = { enable = true; defaultEditor = true; }; |
where defaultEditor sets the EDITOR environment variable. However, that appeared to disable the ability to install VS Code extensions in the normal way. So, I reverted to adding pkgs.vscode to the list of environment.systemPackages
I set some others in configuration.nix:
|
1 2 3 4 5 |
environment.variables = { EDITOR = "code --wait"; SUDO_EDITOR = "code --wait"; VISUAL = "code --wait"; }; |
I was not sure about the NixOS approach to VS Code extensions. However, I installed within VS Code in the normal way:
and set (within VS Code) "haskell.manageHLS": "PATH"